import Vue from 'vue'
import Router from 'vue-router'
import Login from "@/components/Login"
import Home from "@/components/Home"
import UserEdit from "@/components/UserEdit"
import UserAdd from "@/components/UserAdd"

Vue.use(Router)

export default new Router({
  routes: [
    // 登录模块
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    // 主页面，登录成功后跳转到主页面
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    // 员工编辑页面
    {
      path: '/userEdit/:id',  // 需要传递ID参数
      name: 'UserEdit',
      component: UserEdit
    },
    // 员工新增页面
    {
      path: '/userAdd',
      name: 'UserAdd',
      component: UserAdd
    }
  ]
})
